package com.ruoyi.xh.service.impl;

import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.xh.mapper.XhOrderDescMapper;
import com.ruoyi.xh.domain.XhOrderDesc;
import com.ruoyi.xh.service.IXhOrderDescService;

/**
 * 订单明细Service业务层处理
 * 
 * @author songjw
 * @date 2024-12-13
 */
@Service
public class XhOrderDescServiceImpl extends ServiceImpl<XhOrderDescMapper,XhOrderDesc> implements IXhOrderDescService {

    /**
     * 查询订单明细
     * 
     * @param id 订单明细主键
     * @return 订单明细
     */
    @Override
    public XhOrderDesc selectXhOrderDescById(Long id)
    {
        return this.getById(id);
    }

    /**
     * 查询订单明细列表
     * 
     * @param xhOrderDesc 订单明细
     * @return 订单明细
     */
    @Override
    public Page<XhOrderDesc> selectXhOrderDescList(XhOrderDesc xhOrderDesc)
    {
        return new Page<>();
    }

    /**
     * 新增订单明细
     * 
     * @param xhOrderDesc 订单明细
     *
     */
    @Override
    public void insertXhOrderDesc(XhOrderDesc xhOrderDesc)
    {
        this.save(xhOrderDesc);
    }

    /**
     * 修改订单明细
     * 
     * @param xhOrderDesc 订单明细
     *
     */
    @Override
    public void updateXhOrderDesc(XhOrderDesc xhOrderDesc)
    {
        this.updateById(xhOrderDesc);
    }

    /**
     * 批量删除订单明细
     * 
     * @param ids 需要删除的订单明细主键
     *
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void deleteXhOrderDescByIds(Long[] ids)
    {
        this.removeByIds(Stream.of(ids).collect(Collectors.toSet()));
    }
}
